// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IStorageCredentials.cs" company="AzureContrib (Open source library http://azurecontrib.codeplex.com)">
//   Microsoft Public License (Ms-PL)
// </copyright>
// <summary>
//   Exception for errors when handling Windows Azure Cloud Drives.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

using System.Net;

namespace AzureContrib.WindowsAzure.StorageClient
{
	/// <summary>
	/// Wrapper for Microsoft.WindowsAzure.StorageCredentials
	/// </summary>
	public interface IStorageCredentials
	{
		/// <summary>
		/// Gets the wrapped StorageCredentials.AccountNameMicrosoft.WindowsAzure.
		/// </summary>
		string AccountName { get; }

		/// <summary>
		/// Gets a value indicating whether the wrapped Microsoft.WindowsAzure.StorageCredentials.NeedsTransformUri is true or not.
		/// </summary>
		bool NeedsTransformUri { get; }

		/// <summary>
		/// Gets a value indicating whether the wrapped Microsoft.WindowsAzure.StorageCredentials.CanSignRequest is true or not.
		/// </summary>
		bool CanSignRequest { get; }

		/// <summary>
		/// Gets a value indicating whether the wrapped Microsoft.WindowsAzure.StorageCredentials.CanSignRequestLite is true or not.
		/// </summary>
		bool CanSignRequestLite { get; }

		/// <summary>
		/// Gets a value indicating whether the wrapped Microsoft.WindowsAzure.StorageCredentials.CanComputeHmac is true or not.
		/// </summary>
		bool CanComputeHmac { get; }

		/// <summary>
		/// Gets the wrapped credentials behind this contract.
		/// </summary>
		/// <remarks>This <see cref="object"/> is of type Microsoft.WindowsAzure.StorageCredentials.</remarks>
		object WrappedCredentials { get; }

		/// <summary>
		/// Gets the wrapped Microsoft.WindowsAzure.StorageCredentials.TransformUri.
		/// </summary>
		/// <param name="resource">
		/// The resource Uri.
		/// </param>
		/// <returns>
		/// The transformed uri.
		/// </returns>
		string TransformResource(string resource);

		/// <summary>
		/// Signd a request using Microsoft.WindowsAzure.StorageCredentials.SignRequest
		/// </summary>
		/// <param name="request">
		/// The request.
		/// </param>
		void SignRequest(HttpWebRequest request);

		/// <summary>
		/// Signs a request lite using Microsoft.WindowsAzure.StorageCredentials.SignRequestLite
		/// </summary>
		/// <param name="request">
		/// The request.
		/// </param>
		void SignRequestLite(HttpWebRequest request);

		/// <summary>
		/// Computes the Hmac for the <paramref name="value"/> using Microsoft.WindowsAzure.StorageCredentials.ComputeHmac
		/// </summary>
		/// <param name="value">
		/// The value.
		/// </param>
		/// <returns>
		/// The computed hmac.
		/// </returns>
		string ComputeHmac(string value);
	}
}